PACKAGE WL8 - DAILY WORKING LUNCH CAP ENFORCEMENT

Problem
- WL6 capped each working lunch break, but did not cap the total working lunch across the full day.
- That allowed a staff member to clock in again and start another working lunch after already using the full daily lunch allowance.

Correct rule
- Working lunch is capped per staff member per day.
- If lunch setup is 60 minutes, total working lunch for that staff member/date can never exceed 60 minutes.
- If 13 minutes was used earlier, only 47 minutes remain for the rest of that day.
- If 60 minutes has already been used, Start Working Lunch must be blocked for the rest of the day.

Files
- /api/wl8-lunch-common.php
- /api/lunch-start.php
- /api/lunch-end.php
- /api/lunch-status.php
- /cron/auto-close-working-lunch.php
- /sql/verify-wl8-daily-working-lunch-cap.sql
- /README-WL8.txt

Extract inside
- /home/uent/public_html

After extraction
1. Hard refresh the attendance app.
2. If today's staff already used 60+ minutes working lunch, Start Working Lunch should be disabled/blocked.
3. If they used less than 60, they can only use the remaining balance.
4. If they leave it open, cron closes it once the remaining balance is reached.

Cron
Keep running every 5 minutes:
php /home/uent/public_html/cron/auto-close-working-lunch.php

Verification
Run:
/sql/verify-wl8-daily-working-lunch-cap.sql

Query 1 must return zero rows.
